<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>若梦TV，全网品质好单采集平台</title>
	<meta name="keywords" content="若梦、若梦TV、若梦金冠联盟、采集站、淘客、淘宝客、淘客工具、淘客软件、淘客联盟
">
	<meta name="description" content="若梦TV采集站ruomengtv.com，是若梦金冠联盟优质好单采集平台；专注优质商品，严格把控品质，超高转化，提高收益，为淘客提供最好的商品精选采集平台！">
	<link rel="icon" href="favicon.ico">
	<link rel="stylesheet" type="text/css" href="../../lib/css/animate.min.css">
	<link rel="stylesheet" type="text/css" href="../../layui/css/layer.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/jquery.page.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/fakeloader.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/reset.css">
	<link rel="stylesheet" type="text/css" href="../../css/comm.css">
	<link rel="stylesheet" type="text/css" href="../../css/data_main.css">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<link rel="stylesheet" type="text/css" href="../../iconfont/iconfont.css">

	<style>

	</style>
</head>
<body>
	<!-- 头部 -->
	<header class="header">
		<div class="head">
			<div class="head-left left">
				<a href="index.html" title="若梦TV--首页"><img src="../../img/logo.png" alt=""></a>
				<div class="experience">
					<div class="left">体验</div>
					<div class="right"><a href="http://tool.ruomengtv.com" title="天天赚发单助手" target="_blank">天天赚发单助手</a></div>
				</div>
			</div>
			<!--搜索-->
			<div class="left search-wrap active">
				<div class="left">
					<input type="text" placeholder="输入关键词或商品链接">
					<!--搜索历史-->
					<div class="searchHistory">
						<!-- <div class="historyItem">1</div>
						<div class="historyItem">2</div>
						<div class="historyItem">什么事没事没事</div>
						<div class="historyItem">耐克</div>
						<div class="historyItem">鞋子啊</div> -->
					</div>
					<!--搜索历史结束-->
				</div>
				<div class="right">搜索</div>
			</div>
			<!--搜索结束-->
			<div class="head-right right">
				<div class="left login btn" onclick="location.href='../login/login.html';">登录</div>
				<div class="right register btn" onclick="location.href='../login/regsiter.html';">注册</div>
			</div>
			<!--登录后显示区域-->
			<div class="head-right2 right hide">
				<img class="left releaseIcon" src="../../img/head_icon1.png" title="发布" alt="">
				<img class="left informIcon" src="../../img/head_icon2.png" title="未读消息" alt="">
				<div class="left informNum" title="未读消息">0</div>
				<div class="left headOuter" title="个人中心">
					<img class="headPic" src="../../img/default_head.png" alt="">
				</div>
			</div>
			<!--登录后显示区域结束-->
		</div>
	</header>

	<!--主体内容-->
	<div class="wrap">
		<div class="personalMsg">
			<div class="left leftArea">
				<div class="btn checkManageBtn active" onclick="location.href='adminPersonalCenter.html';">审核管理</div>
				<div class="btn" onclick="location.href='adminShelfManage_synthetical.html';">上下架管理</div>
				<div class="btn" onclick="location.href='adminUserManage.html';">用户管理</div>
			</div>
			<div class="left middleArea">
				<div class="headOuter">
					<img class="icon" src="../../img/default_head.png" alt="">
				</div>
				<div class="nickName"><!--管理员昵称--></div>
				<div class="sign"><!--这是一个个性签名哈哈哈哈哈--></div>
			</div>
			<div class="right rightArea">
				<div class="nums">
					<div class="waitcheck">
						<div class="num checkNum">0</div>
						<div class="text checkText">今日待审核</div>
					</div>
				</div>
				<div class="btn modifyBtn" onclick="popShow('.modifiMsgPop');">修改资料</div>
				<div class="btn modifyPhoneBtn" onclick="popShow('.modifiPhonePop');">更改手机号</div>
				<div class="btn signOutBtn">退出</div>
			</div>
		</div>
		<!--时间选择区域-->
		<div class="timeSelectArea">
			<div class="btn back" title="前一天"><i class="iconfont">&#xe602;</i></div>
			<div class="layui-inline">
				<input class="layui-input" placeholder="" onclick="layui.laydate({elem: this, format: 'YYYY-MM-DD'})">
			</div>
			<div class="btn forward" title="后一天"><i class="iconfont">&#xe601;</i></div>
		</div>
		<!--时间选择区域结束-->
		<!--状态类别栏-->
		<div class="statusSorts">
			<span class="btn check active" data-sort=1>待审核<span class="checkNum">（0）</span></span>
			<span class="btn passed" data-sort=2>通过<span class="passedNum">（0）</span></span>
			<span class="btn repulse" data-sort=3>打回<span class="repulseNum">（0）</span></span>
		</div>
		<!--状态类别栏结束-->

		<!--商品展示区域-->
		<div class="goods-wrap">
			<!-- <div class="item item1 checkItem">
				<div class="item-img-wrap">
					<div class="item-img">
						<a href=" https://detail.tmall.com/item.htm?id=555556787890" title="test111" target="_blank"><img class="scrollLoading" src="http://img.taobao218.com/2f1913b3ce63983821ea4f7eca87cc86?imageView2/2/w/480/q/100" data-original="http://img.taobao218.com/2f1913b3ce63983821ea4f7eca87cc86?imageView2/2/w/480/q/100" style="display: inline;"></a>
						<div class="submitPerson hide" style="display: none;">
							<img src="http://img.taobao218.com/1cf8a2499315bc95438d1ebdb2ebd413?imageView2/2/w/480/q/100" alt="">
							<span>提交人- <span>追梦者#933706</span></span>
						</div>
					</div>
					<div class="copy-btn" copy-data="<img src=&quot;http://img.taobao218.com/bf1a3ea4849e462205bca1c69f528870?imageView2/2/w/480/q/100&quot; ><br />test111<br />【聚划算200.0元】券后【130.0元】包邮<br />领券：
http://shop.m.taobao.com/shop/coupon.htm?seller_id=3087155153&amp;activity_id=6053f5beff6549b1aa11f1a5d97cbe17<br />抢购：https://detail.tmall.com/item.htm?id=555556787890<br />文案啊啊啊啊啊啊啊啊啊啊啊啊" data-clipboard-target=".copy-data" style="display: none;">
						复制文案
					</div>
				</div>
				<h1><a href="https://detail.tmall.com/item.htm?id=555556787890" title=" + e.goodsName + " target="_blank">test111</a>
				</h1>
				<div class="coupon">
					<div class="left"><h2>￥<span style="color:#03a9f4">130.00</span></h2> <h3>券后价</h3></div>
					<div class="left"><h2>￥<span>70.00</span></h2> <h3>优惠券</h3></div>
					<div class="left last"><h2>12.00 <span>%</span></h2> <h3>定向</h3></div>
					<div class="clearfix"></div>
				</div>
				<div class="coupon-btn btn"><a href="  " target="_blank"> 哈哈哈 </a></div>
				<div class="submitPerson">
						<img src="http://img.taobao218.com/1cf8a2499315bc95438d1ebdb2ebd413?imageView2/2/w/480/q/100" alt="">
						<span>提交人- <span>追梦者#933706</span></span>
				</div>
				<h4> 2017-08-15 20:17 &nbsp;&nbsp;&nbsp;提交</h4>
				<div class="item-more">
					<div class="right"><img src="../../img/jhs.png" alt=""><img src="../../img/tianmao.png" alt=""></div>
					<div class="clearfix"></div>
				</div>
			</div> -->
		</div>
		<!--商品展示区域结束-->
		<!-- 分页 -->
		<div class="page-wrap" style="display: none;">
			<div id="page"></div>
		</div>
		<!--分页结束-->
	</div>

	<!-- 加载层 -->
	<div class="fakeloader"></div>
	<!-- 复制文案 -->
	<div class="copy-data"></div>
	<!-- 返回顶部 -->
	<div class="scrollTop">
		<div class="scrollTop-top">
		</div>
		<div class="scrollTop-bottom">
			返回顶部
		</div>
	</div>

	<!--遮罩层-->
	<div class="grey hide" onclick="popHide();"></div>
	<!--遮罩层结束-->

	<!--修改资料弹窗-->
	<div class="popUp modifiMsgPop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">修改资料</div>
		</div>
		<div class="contentArea">
			<div class="outer headOuter">
				<label>头像</label>
				<div class="uploadOuter">
					<img src="../../img/head_upload.png" alt="">
					<input type="file" class="addimgIpt" name="file" accept="image/gif,image/jpeg,image/png"/>
				</div>
			</div>
			<div class="outer">
				<label for="nickname">昵称</label>
				<input id="nickname" type="text" maxlength=10 placeholder="请填写昵称">
			</div>
			<div class="outer">
				<label for="sign">个性签名</label>
				<textarea name="" id="sign" maxlength=32 placeholder="请填写个性签名"></textarea>
			</div>
			<!-- <div class="outer">
				<label for="phone">手机号</label>
				<input id="phone" type="tel" placeholder="请填写手机号">
			</div> -->
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--修改资料弹窗结束-->

	<!--修改手机号弹窗-->
	<div class="popUp modifiPhonePop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">修改手机号</div>
		</div>
		<div class="contentArea">
			<div class="outer">
				<span class="oldPhoneOuter">已绑定手机号：</span> <span class="oldPhone"><!-- 1356433290 --></span>
			</div>
			<div class="outer">
				<label for="newPhone">新手机号</label>
				<input id="newPhone" type="tel" placeholder="新手机号">
			</div>
			<div class="outer">
				<label for="imgCode">图片验证码</label>
				<input id="imgCode" type="text" maxlength=4 placeholder="图片验证码">
				<div class="imgVerifiCode"><img src="/user/checkCode" alt=""></div>
			</div>
			<div class="outer">
				<label for="authCode">验证码</label>
				<input id="authCode" type="text" maxlength=6 placeholder="短信验证码">
				<div class="send-code">获取验证码</div>
			</div>
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--修改手机号弹窗结束-->

	<!--审核通过弹窗-->
	<div class="popUp checkPassPop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">操作确认</div>
		</div>
		<div class="contentArea">
			确定审核通过么?
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--审核通过弹窗结束-->

	<!--审核打回弹窗-->
	<div class="popUp checkRefusePop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">操作确认</div>
		</div>
		<div class="contentArea">
			<div class="ask">是否扣分（每次扣10分）</div>
			<div class="select">
				<i class="iconfont" data-index="1">&#xe7b4;</i><span class="yes">是</span>
				<i class="iconfont" data-index="0">&#xe7b4;</i><span>否</span>
			</div>
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--审核打回弹窗结束-->

</body>

<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.page.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/clipboard.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/layer.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/fakeloader.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.lazyload.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/main.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.hDialog.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/data_main.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/send_code.js"></script>
<script>
var usercode = getStorage( "usercode" );
$( function()
{
	//加载个人信息
	getUserMsg( 2 );

	//设置时间控件默认值
	var dataArea = getTimeArea();
	var lastDay = dataArea[1];
	//var todayDate = format( new Date(), 'yyyy-MM-dd' );
	$( ".layui-input" ).val( lastDay );

	//默认加载最新日待审核数据
	get_examineManage_goods( 1, 1, lastDay );

	//切换单据状态
	$( ".statusSorts .btn" ).click( function()
	{
		$( ".statusSorts .btn" ).removeClass( "active" );
		$( this ).addClass( "active" );
		var examine_status = $( this ).attr( "data-sort" );
		var createTime = $( ".layui-input" ).val();
		get_examineManage_goods( 1, examine_status, createTime );

	} );
	//根据时间查询-直接选择
	document.getElementsByClassName( 'layui-input' )[ 0 ].onclick = function()
	{
		var timeArea = getTimeArea();
		var startDay=timeArea[0];
		var endDay=timeArea[1];
		
		layui.laydate( {
			elem: this,
			format: 'YYYY-MM-DD',
			min: startDay,
			max: endDay,
			choose: function( dates )
			{ //选择好日期的回调
				var examine_status = $( ".statusSorts .btn.active" ).attr( "data-sort" );
				getThreeNum( dates, 0 );
				get_examineManage_goods( 1, examine_status, dates );
			}
		} );
	};
	//根据时间查询-前一天
	$( ".timeSelectArea .back" ).click( function()
	{
		var timeArea = getTimeArea();
		var startDay=timeArea[0];
		
		var layuiInput = $(".layui-input").val();
		if(startDay==layuiInput){
			$.tooltip( "到底了" );
			return false;
		}
		var newDate = previousDay();
		var examine_status = $( ".statusSorts .btn.active" ).attr( "data-sort" );
		getThreeNum( newDate, 0 );
		get_examineManage_goods( 1, examine_status, newDate );
	} );
	//根据时间查询-后一天
	$( ".timeSelectArea .forward" ).click( function()
	{
		var timeArea = getTimeArea();
		var endDay=timeArea[1];
		var layuiInput = $(".layui-input").val();
		if(endDay==layuiInput){
			$.tooltip( "到底了" );
			return false;
		}
		var newDate = nextDay();
		var examine_status = $( ".statusSorts .btn.active" ).attr( "data-sort" );
		getThreeNum( newDate, 0 );
		get_examineManage_goods( 1, examine_status, newDate );
	} );
	

} );

//获取审核管理列表
function get_examineManage_goods( page, examine_status, createTime )
{
	var dataJson = {
		"pageIndex": page,
		"examine_status": examine_status,//单子状态
		"createTime": createTime,//单子提交日期
		"mUsercode": usercode//当前管理员
	};
	$.ajax( {
		type: "POST",
		url: ajaxUrl + "/p-info/examineManage",
		data: dataJson,
		success: function( data )
		{
			console.log( JSON.stringify( data ) );
			if( data.code == 0 )
			{
				var count = data.data.count;
				if( examine_status == 1 )
				{
					$( ".statusSorts .checkNum" ).text( "（" + count + "）" );
				}
				else
					if( examine_status == 2 )
					{
						$( ".statusSorts .passedNum" ).text( "（" + count + "）" );
					}
					else
					{
						$( ".statusSorts .repulseNum" ).text( "（" + count + "）" );
					}
				var lists = data.data.data;
				if( lists.length != 0 )
				{
					var result = "";
					$.each( lists, function( i, list )
					{
						var submitUsercode = list.usercode;
						var commissionProportion = list.commissionProportion;//佣金比例
						var commissionType = getCommissionType( list.commissionType );//佣金类型
						var count = list.count;//优惠券
						var voucherPrice = list.voucherPrice;//券后价
						var submitTime = format( parseInt( list.createTime ), "yyyy-MM-dd HH:mm" );//提交时间
						var goodsName = list.goodsName;
						var img = list.img;//商品图
						var img2 = list.img2;//文案图
						var message = list.message;
						var itemId = list.itemId;//商品id
						var couponId = list.couponId;//优惠券id
						var submitPerson = list.submitPerson;
						var shopType = list.shopType;
						var imgUrl, goodsHref;
						if( shopType == 2 )
						{  //   天猫
							imgUrl = '../../img/tianmao.png';
							goodsHref = "https://detail.tmall.com/item.htm?id=" + itemId;
						}
						else
						{  // 淘宝
							imgUrl = '../../img/taobao.png';
							goodsHref = "https://item.taobao.com/item.htm?id=" + itemId;
						}

						var goodType = list.goodType;//活动类型
						var goodsType = "";
						if( goodType == 1 )
						{//聚划算
							goodsType = '<img src="../../img/jhs.png" alt="">';
						}
						else
							if( goodType == 2 )
							{
								// 淘抢购
								goodsType = '<img src="../../img/tqg.png" alt="">';
							}
						var btnAreaText = "";
						if( examine_status == 1 )
						{//待审核，有审核按钮
							btnAreaText = '<div class="btnArea hide"> ' +
														'<div class="btn pass" onclick="passOrRefuse(this);" couponId=' + couponId + ' createTime=' + submitTime + ' usercode=' + submitUsercode + '>通过</div>' +
														'<div class="btn refuse" onclick="passOrRefuse(this);" couponId=' + couponId + ' createTime=' + submitTime + ' usercode=' + submitUsercode + '>打回</div> ' +
														'</div> ';
						}
						result += '<div class="item item1 checkItem" > ' +
											'<div class="item-img-wrap"> ' +
											'<div class="item-img"> ' +
											'<a href=" ' + goodsHref + '" title=' + goodsName + ' target="_blank"><img class="scrollLoading" src=' + img + ' data-original="' + img + '"></a> ' +
											btnAreaText +
											'</div> ' +
											'<div class="copy-btn" copy-data=\'<img src="' + img2 + '" >' + message + '\' data-clipboard-target=".copy-data">复制文案 </div> ' +
											'</div> ' +
											'<h1> <a href="' + goodsHref + '" title=" + e.goodsName + " target="_blank">' + goodsName + '</a></h1> ' +
											'<div class="coupon"> ' +
											'<div class="left"> ' +
											'<h2>￥<span style="color:#03a9f4">' + voucherPrice + '</span></h2> ' +
											'<h3>券后价</h3> ' +
											'</div> ' +
											'<div class="left"> ' +
											'<h2>￥<span>' + count + '</span></h2> ' +
											'<h3>优惠券</h3> ' +
											'</div> ' +
											'<div class="left last"> ' +
											'<h2>' + commissionProportion + ' <span>%</span></h2> ' +
											'<h3>' + commissionType + '</h3> ' +
											'</div> ' +
											'<div class="clearfix"></div> ' +
											'</div> ' +
											'<div class="submitPerson" onclick="location.href=\'userManageDetails.html?usercode='+submitUsercode+'\'">'+
											'<img src="' + list.icon + '" alt="">'+
											'<span>提交人- <span>' + submitPerson + '</span></span>'+
											'</div>'+
											'<h4> ' + submitTime + ' &nbsp;&nbsp;&nbsp;提交</h4> ' +
											'<div class="item-more"> ' +
											'<div class="right">' + goodsType + '<img src="' + imgUrl + '" alt=""></div> ' +
											'<div class="clearfix"></div> ' +
											'</div> ' +
											'</div>';
					} );
					result += '<div class="clearfix"></div>';
					$( ".goods-wrap" ).html( result );
					imgLazyLoad();
					copy_int();//出现文案提示
					//分页
					$( ".page-wrap" ).show();//显示分页
					$( "#page" ).Page( {
						totalPages: data.data.pages,//分页总数
						liNums: 7,//分页的数字按钮数(建议取奇数)
						current: page, //当前页
						activeClass: 'activP', //active 类样式定义
						callBack: function( page )
						{
							$( 'body,html' ).animate( { scrollTop: '400px' }, 500 );
							page++;
							get_examineManage_goods( page, examine_status, createTime );
						}
					} );
				}
				else
				{
					var s = '<div class="no-data">' +
									'<img src="../../img/no_data.png" alt="">' +
									'什么都没找到,怪我咯~' +
									'<div>';
					$( '.goods-wrap' ).html( s );
					$( ".page-wrap" ).hide();//隐藏分页
				}

			}
			else
			{
				$.tooltip( data.message );
			}
		},
		error: function( data )
		{
			$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
		}
	} );
}
//获取时间区间

function getTimeArea(){
	var startDay,endDay;
	$.ajax( {
		type: "POST",
		async:false,
		url: ajaxUrl + "/user/examinedStartTime",
		data: { "mUsercode": usercode },
		success: function( data )
		{
			console.log( JSON.stringify( data ) );
			if( data.code == 0 )
			{
				var time = data.data.time;
				startDay = format(time.startDay,"yyyy-MM-dd");
				endDay = format(time.endDay,"yyyy-MM-dd");	
			}
			else
			{
				$.tooltip( data.message );
			}
		},
		error: function( data )
		{
			$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
		}
	} );
	return [startDay,endDay];
}
</script>
</html>